package com.google.code.sfa;
import com.google.code.sfa.parse.*;
import com.google.code.sfa.tigr.*;
import com.google.code.sfa.nextgen.*;
import java.io.IOException;
import java.util.List;

public class Program {

    public static void main( String[] argv) throws Exception {

	int seed = Integer.parseInt( argv[2]);
	String file = argv[1];
	TraceConsensusParser parser = new TraceConsensusParser( file);
	if( !parser.parse()) {
	    System.err.println( "Error occurred while parsing");
	    return;
	}

	if( argv[0].equals("greedy")) {
	    System.out.println("Greedy");
	    Simulator s = new Simulator( parser.getConsensus(), 0.95f, 8.0f, 0.98f, 500, 1500, seed);   
	    
	    TigrAssembler assembler = new TigrAssembler();
	    assembler.assemble( s.getTraces(), 12);
	} else {
	    System.out.println("NextGen");
	    Simulator s = new Simulator( parser.getConsensus(), 0.95f, 8.0f, 0.98f, 32, 50, seed);
	    NextGenSequencer nextgen = new NextGenSequencer();
	    nextgen.assemble( s.getTraces(), parser.getConsensus(), s.getSubject());
	}

    }
}
    /*
	    int nmerSize = Integer.parseInt( argv[2]);
	    
	    TraceInfoParser parser = new TraceInfoParser( file);
	    if( !parser.parse() ) {
		System.err.println( "Error occurred while parsing.");
		return;
	    }
	    TraceDatabase traceDb = parser.getTraceDatabase();
	    List<Trace> traces = traceDb.toList();    
    */
